<?php
require(dirname(__file__).'/scot-config.php');
require(WORDPRESS_ROOT.'wp-config.php');
require(SCOT_EXPORTER_ROOT.'/scot-setting.php');

$source = new Source();
$type = $_GET['type'];
$tag = $_GET['tag'];

if($type == null) {
	$site = $source->getInfo(SCOT_SOURCE_SITE_URL, null);
	$tagid = $source->getInfo(SCOT_SORUCE_TAG_ID, $tag);
//	echo("Location: $site/index.php?cat=".$tagid);
//	echo("<script>window.location.replace('$site/index.php?cat=$tagid');</script>");
	header("Location: $site/index.php?cat=".$tagid);
	
} else {
	echo("resources for tag '$tag' in '$type' type");
}
?>